#ifndef INKY_STACK_H_
#define INKY_STACK_H_

#include<stdlib.h>
#include<stdio.h>

#define IN_STACK    1
#define IDLE        0
#define OUT_STACK   2

// struct node;
struct node {
    int x;
    int y;
    struct node * next;
    int dir;
};
typedef struct node Node;
typedef struct node * Stack;

Node * NewNode(int x, int y);

Stack InitStack(Stack stack);

Node * PopStack(Stack stack, Node * target);

Node * PushStack(Stack stack, Node * srNode);

Node * Resolve(int maze[][12], int x_in, int y_in);

void OutMaze(int maze[][12], Stack stack);

int IsNew(int x, int y, int maze[][12]);

int IsSafe(int x, int y, int maze[][12]);

int SetFlag(int x, int y, int maze[][12]);

Node * NextPose(Node * cur);

int IsEmpty(Stack stack);

void PrintPath(Stack path);

#endif